//
//  HBNovelCell.m
//  HeartBeat
//
//  Created by karong on 2023/8/23.
//

#import "HBNovelCell.h"
#import "NSString+Number.h"
#import "UIView+WSDraw.h"
@interface HBNovelCell ()
@property (weak, nonatomic) IBOutlet UIImageView *imageView;
@property (weak, nonatomic) IBOutlet UILabel *nameLabel;
@property (weak, nonatomic) IBOutlet UILabel *descLabel;
@property (weak, nonatomic) IBOutlet UIButton *totalViewsBtn;
@property (weak, nonatomic) IBOutlet UIButton *vipBtn;
@end
@implementation HBNovelCell
- (void)awakeFromNib {
    [super awakeFromNib];
    [self.vipBtn setupRoundedCornersWithCutCorners:(UIRectCornerTopLeft | UIRectCornerBottomRight) withRadii:CGSizeMake(8, 8)];
}

- (void)setDataWithObject:(HBNovelModel *)object {
    [self.imageView sd_setImageWithURL:[NSURL URLWithString:object.thumb] placeholderImage:HBPlaceholderImage];
    self.nameLabel.text = object.name;
    self.descLabel.text = object.desc;
    [self.totalViewsBtn setTitle:[NSString ws10RankThousands1DecimalWithValue:object.total_views] forState:(UIControlStateNormal)];
    [self.totalViewsBtn setButtonImageTitleStyle:(WSButtonImageTitleStyleLeft) padding:4.5];
    self.vipBtn.hidden = !(object.show_vip_tag == 1);
//    [self.vipBtn setTitle:WSLocalized(@"VIP免費") forState:(UIControlStateNormal)];
}
@end
